<?php

return [
    'server' => [
        'listener' => [
            'host' => '127.0.0.1',
            'port' => 8090,
            'mode' => SWOOLE_SOCK_TCP
        ],
        // tunnel
        'listeners' => [
            'server' => [
                'host' => '127.0.0.1',
                'port' => 8091,
                'mode' => SWOOLE_SOCK_TCP
            ],
            'tunnel' => [
                'host' => '127.0.0.1',
                'port' => 8092,
                'mode' => SWOOLE_SOCK_TCP
            ]
        ],
        'channel' => [
            'size' => 10
        ],
        'swConfig' => [
            'pid_file'              => runtime_path() . 'proxy-server.pid',
            'log_file'              => runtime_path() . 'proxy-server.log',
            'daemonize'             => false,
            'task_enable_coroutine' => true,
            'task_use_object'       => true,
            'reactor_num'           => swoole_cpu_num(),
            'worker_num'            => swoole_cpu_num(),
            'task_worker_num'       => swoole_cpu_num(),
            'package_max_length'    => 20 * 1024 * 1024,
            'buffer_output_size'    => 10 * 1024 * 1024,
            'socket_buffer_size'    => 128 * 1024 * 1024,
//            'max_wait_time'         => 3000,
//            'open_eof_check'        => true,
//            'package_eof'           => "\r\n"
        ]
    ],
    'client' => [
        'server' => [
            'host' => '127.0.0.1',
            'port' => 8091,
            'mode' => SWOOLE_SOCK_TCP
        ],
        'tunnel' => [
            'host' => '127.0.0.1',
            'port' => 8092,
            'mode' => SWOOLE_SOCK_TCP
        ],
        'local' => [
            'host' => '127.0.0.1',
            'port' => 80,
            'mode' => SWOOLE_SOCK_TCP
        ],
        'swConfig' => [
            'pid_file'              => runtime_path() . 'proxy-client.pid',
            'log_file'              => runtime_path() . 'proxy-client.log',
            'daemonize'             => false,
            'reactor_num'           => swoole_cpu_num(),
            'worker_num'            => swoole_cpu_num(),
            'task_worker_num'       => swoole_cpu_num(),
            'package_max_length'    => 20 * 1024 * 1024,
            'buffer_output_size'    => 10 * 1024 * 1024,
            'socket_buffer_size'    => 128 * 1024 * 1024,
//            'max_wait_time'         => 3000,
//            'open_eof_check'        => true,
//            'package_eof'           => "\r\n"
        ]
    ]
];